<extend name="desktop_default/template/user/base_user" />
<block name="area_header">
    <link rel="stylesheet" href="__CSS__/user/message/style.css">
</block>

<block name="area_top">

</block>
<block name="user_top">

</block>
<block name="main_content">
    <div class="message">
        <div class="user-tab">
            <a href="{:U('mengwu/user/message/t/system')}">系统通知</a>
            <a href="{:U('mengwu/user/message/t/comment')}">评论</a>
            <a href="{:U('mengwu/user/message/t/focus')}">关注</a>
            <a href="{:U('mengwu/user/message/t/zan')}">赞</a>
            <a class="selected" href="{:U('mengwu/user/message/t/sx')}">私信</a>
        </div>
        <div class="sx">
            <empty name="list">
                <div class="empty-list">没有任何私信哦~</div>
                <else/>
                <ul class="sx-list">
                    <volist name="list" id="vo">
                        <li>
                            <div class="head">
                                <notempty name="vo.from_head">
                                    <img src="{$vo.from_head}">
                                    <else/>
                                    <img src="__IMG__/common/xlogo.png">
                                </notempty>
                            </div>
                            <div class="content">
                                <div class="title">
                                    <em class="name">{$vo.from_nick|default='系统'}</em>
                                </div>
                                <div class="note">{$vo.content}</div>
                            </div>
                            <div class="date">{$vo.send_time|date='Y-m-d H:i:s',###}</div>
                            <a class="delete" data-id="{$vo.id}" href="javascript:void(0);"><img src="__IMG__/user/common/xdelete.png"></a>
                        </li>
                    </volist>
                </ul>
            </empty>
            {$show}
        </div>


    </div>

</block>
<block name="area_footer">
    <script type="text/javascript">
        var confirm = antd.Modal.confirm;
        var message = antd.message;
        $('.delete').click(function(){
            var id = $(this).attr('data-id');
            confirm({
                title: '您是否确认要删除这条私信吗',
                content: '',
                onOk:function() {
                    var hide = message.loading('正在执行中...',0);
                    var url = document.getElementsByTagName('base')[0].href + '/mengwu/mengwuApi/message_delete';
                    let data = {
                        id: id
                    };
                    _post(url,jQuery.param(data), {
                        //处理返回数据
                        data_back: function(data){
                            hide();
                            setTimeout(function(){
                                if(data.status){
                                    message.success('操作成功！');
                                    setTimeout(function(){window.location.reload()},500);
                                }else{
                                    message.error('操作失败！');
                                }
                            },500);

                        }
                    });
                },
                onCancel:function() {}
            });
        });
    </script>
</block>
